I am using OLE Automation to get and set data within another application. One of the properties of the OleAutoObj that I am dealing with is effectively an array of data. I can 'get' data from this array by using oleGet with AutoArgs, however I am unable to 'set' the same piece of data, as there is no olePut function for which I can supply AutoArgs as an argument. The section of code for the 'get' is as follows:
OleAutoObj nodeAutoObj
string nodeConf = ""
OleAutoArgs autoArgs = create
clear autoArgs
put(autoArgs, "confidence")
string err = oleGet(nodeAutoObj, "StatusField", autoArgs, nodeConf)
if(!null err)
{
errorBox "ERROR getting nodeConf: " err
}
if(!null nodeConf)
{
infoBox "nodeConf: " nodeConf
}
clear autoArgs
put(autoArgs, "confidence")
err = olePut(nodeAutoObj, "StatusField", autoArgs, "Low")
if(!null err)
{
errorBox "ERROR setting nodeConf: " err
}
SystemAdmin - Tue May 10 08:20:12 EDT 2011 |
Re: Missing function - olePut with AutoArgs? Hmm what you are describing sound not like a normal "array" ... DXL does not support COM arrays, but that does not seem to be your problem... COM objects like a VB collection have "default" methods. This means when you call: MyCollection(3) = 4 x = MyCollection(6)
MyCollection.Items(3).Value = 4 x = MyCollection.Items(6).Value
clear autoArgs OleAutoObj objField put(autoArgs, "StatusField") oleMethod(nodeAutoObj, "Fields", autoArgs, objField) olePut(objField, "confidence", "Low")
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Missing function - olePut with AutoArgs? Mathias Mamsch - Tue May 10 09:30:58 EDT 2011 Hmm what you are describing sound not like a normal "array" ... DXL does not support COM arrays, but that does not seem to be your problem... COM objects like a VB collection have "default" methods. This means when you call: MyCollection(3) = 4 x = MyCollection(6)
MyCollection.Items(3).Value = 4 x = MyCollection.Items(6).Value
clear autoArgs OleAutoObj objField put(autoArgs, "StatusField") oleMethod(nodeAutoObj, "Fields", autoArgs, objField) olePut(objField, "confidence", "Low")
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
My colleague, had a similar problem setting some data in MS Word 2003, where he was trying to specify a 'WdCompatibility' element value in the Compatibility property: Application.Document.Compatibility(WdCompatibility) = false Compatibility is a Property not a Method WdCompatibility is an integer This is essentially the same problem, however might easier to investigate, as most people have Word. |
Re: Missing function - olePut with AutoArgs? SystemAdmin - Tue May 10 10:20:01 EDT 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Missing function - olePut with AutoArgs? Mathias Mamsch - Tue May 10 13:39:48 EDT 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |